package com.dyzx.hbb.modules.fcxs.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dyzx.hbb.common.config.MyLambdaQueryWrapper;
import com.dyzx.hbb.modules.fcxs.entity.FcxsDiscount;
import com.dyzx.hbb.modules.fcxs.entity.FcxsSchedule;
import com.dyzx.hbb.modules.fcxs.service.FcxsScheduleService;
import com.dyzx.hbb.modules.fcxs.mapper.FcxsScheduleMapper;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
* @author Administrator
* @description 针对表【fcxs_schedule(进度表)】的数据库操作Service实现
* @createDate 2025-05-17 20:53:29
*/
@Service
public class FcxsScheduleServiceImpl extends ServiceImpl<FcxsScheduleMapper, FcxsSchedule>
    implements FcxsScheduleService{

    @Override
    public List<Map<String, Object>> findByOrderIdList(Long orderId) {
        return this.listMaps(queryInfoWrapper().eq(FcxsSchedule::getOrderId, orderId));
    }

    protected MyLambdaQueryWrapper<FcxsSchedule> queryInfoWrapper() {
        MyLambdaQueryWrapper<FcxsSchedule> queryWrapper = new MyLambdaQueryWrapper<>();
        queryWrapper.select(FcxsSchedule::getId)
                .fcxsOrderNo(FcxsSchedule::getOrderId).as("order_no")
                .select(FcxsSchedule::getResult)
                .select(FcxsSchedule::getApprovalStatus)
                .select(FcxsSchedule::getStatus)

                .select(FcxsSchedule::getCreateDate)
                .select(FcxsSchedule::getUpdateDate)
                .organName(FcxsSchedule::getOrganId).as("organ_name")
                .userName(FcxsSchedule::getOperatorId).as("operator_name");
        return queryWrapper;
    }
}




